package com.yykj.user.center.server.model;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.yykj.common.util.serializer.LocalDate2LongSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.ColumnDefault;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.UpdateTimestamp;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import java.time.LocalDateTime;

/**
 * @author chenl
 * @version 1.0
 * @date 2021/11/16 21:51
 */
//分组或标签
@Data
@Entity
public class Group {

    @Id
    private String id;

    private String name;

    private String doctorId;

    private Integer hospitalId;

    @ApiModelProperty("类型：1分组 2标签")
    private Integer type=1;

    @ApiModelProperty("创建时间")
    @JsonSerialize(using = LocalDate2LongSerializer.class)
    @CreationTimestamp
    private LocalDateTime createTime;

    @ApiModelProperty("更新时间")
    @JsonSerialize(using = LocalDate2LongSerializer.class)
    @UpdateTimestamp
    private LocalDateTime updateTime;

    private Boolean state=true;

    @ApiModelProperty("是否是默认分组")
    @Column(columnDefinition="boolean default false")
    private Boolean isDefault;
}
